package com.onegene.pdf.component.report.colon;

import com.itextpdf.kernel.colors.ColorConstants;
import com.itextpdf.layout.Style;
import com.itextpdf.layout.borders.Border;
import com.itextpdf.layout.borders.SolidBorder;
import com.itextpdf.layout.property.TextAlignment;
import com.itextpdf.layout.property.UnitValue;
import com.itextpdf.layout.property.VerticalAlignment;

/**
 * @author: laoliangliang
 * @description:
 * @create: 2020/5/20 8:34
 **/
public class ColonStyle {
    public static Style getDefaultCell() {
        Style style = new Style();
        style.setBorder(new SolidBorder(ColonColor.getThemeColor(), 0.5f));
        style.setTextAlignment(TextAlignment.CENTER);
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        style.setPadding(5);
        return style;
    }
    public static Style getSloganCell() {
        Style style = new Style();
        style.setBorder(Border.NO_BORDER);
        style.setTextAlignment(TextAlignment.CENTER);
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        return style;
    }

    public static Style getExamineeCell() {
        Style style = new Style();
        style.setBorder(Border.NO_BORDER);
        style.setTextAlignment(TextAlignment.LEFT);
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        style.setWidth(UnitValue.createPercentValue(50));
        style.setPaddings(6,0,6,20);
        return style;
    }

    public static Style getTitleStyle() {
        Style style = new Style();
        style.setFontSize(15);
        style.setFontColor(ColonColor.getThemeColor());
        return style;
    }

    public static Style getExamineeCellParagraph() {
        Style style = new Style();
        style.setMargins(0, 0, 0, 0);
        return style;
    }

    public static Style getNormalParagraph() {
        Style style = new Style();
        style.setFontSize(10.5f);
        return style;
    }

    public static Style getResultParagraph() {
        Style style = new Style();
        style.setFontSize(10.5f);
        style.setBold();
        return style;
    }

    public static Style getHeaderCellStyle() {
        Style style = new Style();
        style.setFontSize(11f);
        style.setBold();
        style.setBackgroundColor(ColonColor.getThemeColor());
        style.setFontColor(ColorConstants.WHITE);
        style.setBorder(new SolidBorder(ColonColor.getThemeColor(), 0.5f));
        style.setTextAlignment(TextAlignment.CENTER);
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        return style;
    }

    public static Style getDefaultThemeCellStyle() {
        Style style = new Style();
        style.setBorder(new SolidBorder(ColonColor.getThemeColor(), 0.5f));
        style.setTextAlignment(TextAlignment.CENTER);
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        return style;
    }
}